import {
	mapMutations
} from 'vuex'

export default {
	...mapMutations([
		'upIndexInfo',
	]),
	// 预览图片
	previewImage(url, index) {
		uni.previewImage({
			current: index, // 当前显示图片的链接/索引值
			urls: [url], // 需要预览的图片链接列表，photoList要求必须是数组
			loop: true // 是否可循环预览
		});
	},
	getPageList() {
		let that = this
		that.$httpRequest.get({
			that: that,
			url: 'wechat/getMyInformationList',
			params: {
				type: 2,
				pageNo: that.page,
				pageSize: that.list_rows,
			},
			success: res => {
				that.loading = false
				if (res.code === that.$httpConfig.SUCCESS_CODE) {
					console.log(res.data)
					if (that.page === 1) {
						that.list = res.data.rows
					} else {
						that.list = that.list.concat(res.data.rows)
					}
					that.page++
				} else {

				}
			}
		})
	},
	toEdit(id) {
		uni.navigateTo({
			url: '/pages/my/send?id=' + id
		})
	},
	toProduct(id) {
		uni.navigateTo({
			url: '/pages/index/product?id=' + id
		})
	},
}